﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Empires.CRL.DataContract
{
    public class DefaultDataPack
    {
        #region 筛选相关
        public int ID { get; set; }
        public string TYPE { get; set; } //筛选类型
        public string SUBJECT { get; set; } //主题筛选
        #endregion

        #region 核心字段
        public string TITLE { get; set; }
        public string DATE { get; set; }
        public int HIT { get; set; }
        public string RATE { get; set; } //评价
        public string FROM { get; set; } //来源
        public string ABSTRACT { get; set; } //摘要
        public string AUTHOR { get; set; } //相关作者（编辑）
        public string CONTENT { get; set; } //文本
        public string AddRESS { get; set; } //地址
        public string ZIPCODE { get; set; } //邮编
        public string PHONE { get; set; } //联系电话
        public string URL { get; set; } //相关图片链接
        public int REPLYTIME { get; set; } //回复次数
        public bool ISREPLY { get; set; } //是否已经得到回复
        public bool ISMAIN { get; set; } //是否是重要（置顶）信息
        #endregion

        #region 身份验证
        private string _master = "anonymity";
        /// <summary>
        /// 当前用户
        /// </summary>
        public string MASTER
        {
            get { return _master; }
            set { this._master = value; }
        }

        private int _group = (int)AuthGroup.normal;
        /// <summary>
        /// 所在组
        /// </summary>
        public int GROUP
        {
            get { return _group; }
            set { this._group = value; }
        }
        private int _subgroup = -1;
        /// <summary>
        /// 自定义权限，默认为未启用
        /// </summary>
        public int SUBGROUP
        {
            get { return _subgroup; }
            set { this._subgroup = value; }
        }
        #endregion

        #region 分页相关字段
        public int ITEMCOUNT { get; set; } //一共有多少条记录
        public int PAGECOUNT { get; set; } //一共有多少条记录
        public int CURRENTPAGE { get; set; } //当前第几页
        public int PAGESIZE { get; set; } //每页多少条记录
        public int PREVIOUSPAGE { get; set; } //上一页索引
        public int NEXTPAGE { get; set; } //下一页索引
        public int FIRSTPAGE { get; set; } //首页索引
        public int LASTPAGE { get; set; } //末页索引
        #endregion

        #region 主题描述
        public string INFOID { get; set; }
        public string INFOPHOTO { get; set; }
        public string PHOTOTITLE { get; set; }
        public string INFOLINK { get; set; }
        #endregion

        #region 扩展字段
        public string EXTFIELD1 { get; set; }
        public string EXTFIELD2 { get; set; }
        public string EXTFIELD3 { get; set; }
        public string EXTFIELD4 { get; set; }
        public string EXTFIELD5 { get; set; }
        #endregion
    }
    [Flags]
    public enum AuthGroup
    {
        /// <summary>
        /// 自定义权限
        /// </summary>
        define = 1,        //0000000001
        /// <summary>
        /// 游客
        /// </summary>
        normal = 2,        //0000000010
        /// <summary>
        /// 会员
        /// </summary>
        member = 4,        //0000000100
        /// <summary>
        /// 客户
        /// </summary>
        customer = 8,      //0000001000
        /// <summary>
        /// 特殊会员
        /// </summary>
        special = 16,      //0000010000
        /// <summary>
        /// 贵宾
        /// </summary>
        vip = 32,          //0000100000
        /// <summary>
        /// 普通管理员（版主）
        /// </summary>
        admin = 64,        //0001000000
        /// <summary>
        /// 站点管理员
        /// </summary>
        siteAdmin = 128,   //0010000000
        /// <summary>
        /// 系统管理员
        /// </summary>
        systenAdmin = 256, //0100000000
        /// <summary>
        /// 超级管理员
        /// </summary>
        master = 512       //1000000000
    }
}
